package com.ghy.constant;

import java.util.Arrays;
import java.util.List;
import java.util.Objects;

/**
 * @author GaoHeYang
 */
public class ML {
    public interface Redis {
        /** 手机登录验证码Key值前缀*/
        String VCODE_PREFIX = "vcode:";

    }
    public interface MinIO {
        /**桶名*/
        String BUCKET_NAME = "mylesson";
        /**头像上传目录*/
        String AVATAR_DIR = "avatar";
        /**课程封面上传目录*/
        String COURSE_COVER_DIR = "course-cover";
        /**课程摘要上传目录*/
        String COURSE_SUMMARY_DIR = "course-summary";
        /**集次视频封面上传目录*/
        String EPISODE_VIDEO_COVER_DIR = "episode-video-cover";
        /**集次视频上传目录*/
        String EPISODE_VIDEO_DIR = "episode-video";
        /**轮播图片上传目录*/
        String BANNER_DIR = "banner";
    }
    public interface Banner{
        /**横幅默认图片*/
        String DEFAULT_BANNER = "default-banner.jpg";

    }
    public interface Order {
        /**订单状态：0未付款，1已付款，2已取消，3其他*/
        Integer UNPAID = 0, PAID = 1, CANCEL = 2, OTHER_STATE = 3;
        /**支付方式：0未支付，1微信，2支付宝，3其他*/
        Integer NO_PAY = 0, WECHAT_PAY = 1, ALI_PAY = 2, OTHER_PAY = 3;
        /**报表相关：报表名称，Sheet名称 */
        String EXCEL_FILE_NAME = "订单统计表.xlsx", EXCEL_SHEET_NAME = "sheetO01";
        static String statusFormat(Integer statusCode) {
            if (Objects.equals(statusCode,UNPAID)) return "未付款";
            if (Objects.equals(statusCode,PAID))return "已付款";
            if (Objects.equals(statusCode,CANCEL)) return "已取消";
            if (Objects.equals(statusCode, OTHER_STATE)) return "其他";
            return"异常";
        }

        static String payTypeFormat(Integer payTypeCode) {
            if (Objects.equals(payTypeCode,NO_PAY)) return "未支付";
            if (Objects.equals(payTypeCode, WECHAT_PAY)) return "微信";
            if (Objects.equals(payTypeCode, ALI_PAY)) return "支付宝";
            if (Objects.equals(payTypeCode, OTHER_PAY)) return "其他";
            return"异常";
        }
    }

    public interface Course {
        /** 摘要默认图片*/
        String DEFAULT_SUMMARY = "default-course-summary.jpg";
        /**课程封面默认图片*/
        String DEFAULT_COVER = "default-course-cover.jpg";
    }

    public interface Episode {
        /** 集次默认视频 */
        String DEFAULT_VIDEO = "default-episode-video.mp4";
        /** 集次默认视频封面图*/
        String DEFAULT_VIDEO_COVER = "default-episode-video-cover.jpg";
        /**报表相关：报表名称，Sheet名称 */
        String EXCEL_FILE_NAME = "视频集统计表.xlsx",EXCEL_SHEET_NAME = "sheetOO1";
    }

    public interface User {
        /**用户性别：0女，1男，2保密*/
        Integer FEMALE = 0, MALE = 1, SECRET = 2;
        /**报表相关：报表名称，Sheet名称 */
        String EXCEL_FILE_NAME = "用户统计表.xlsx", EXCEL_SHEET_NAME = "sheetOO1";
        /**默认密码 */
        String DEFAULT_PASSWORD = "123456789";
        /**用户默认头像：12生肖图*/
        List<String> DEFAULT_AVATARS = Arrays.asList(
                "mouse.png", "cow.png", "tiger.png", "rabbit.png", "dragon.png", "snake.png",
                "horse.png", "sheep.png", "monkey.png", "chicken.png", "dog.png", "pig.png");

        static String genderFormat(Integer genderCode) {
            if(Objects.equals(genderCode,FEMALE))return "女孩";
            if (Objects.equals(genderCode,MALE)) return "男孩";
            if (Objects.equals(genderCode,SECRET)) return "保密";
            return"异常";
        }
    }
    public interface Menu {
        /** 根菜单ID*/
        Long ROOT_ID = 0L;
    }

    public interface Seckill {
        /*＊秒杀活动状态：0未开始，1已开始，2已结束*/
        Integer NOT_START = 0, STARTED = 1, ENDED = 2;
    }

}
